# 获取visual studio版本
macro(DETECT_VISUAL_STUDIO_VERSION version)
    while(1)
        # visual studio 2010 ##################################################
        string(COMPARE EQUAL ${CMAKE_GENERATOR} "Visual Studio 10 2010" ver_MATCH)
        if(ver_MATCH)
            set(${version} "vs10")
            break()
        endif()
        
        string(COMPARE EQUAL ${CMAKE_GENERATOR} "Visual Studio 10 2010 Win64" ver_MATCH)
        if(ver_MATCH)
            set(${version} "vs10w64")
            break()
        endif()
    
        # visual studio 2013 ##################################################
        string(COMPARE EQUAL ${CMAKE_GENERATOR} "Visual Studio 12 2013" ver_MATCH)
        if(ver_MATCH)
            set(${version} "vs12")
            break()
        endif()
        
        string(COMPARE EQUAL ${CMAKE_GENERATOR} "Visual Studio 12 2013 Win64" ver_MATCH)
        if(ver_MATCH)
            set(${version} "vs12w64")
            break()
        endif()
    endwhile()
endmacro()